using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using StudentVideo.Common.Attributes;
using StudentVideo.Helper;
using StudentVideo.Services;
using StudentVideo.Shared.Dtos.User;
using StudentVideo.Shared.Enums;

namespace StudentVideo.Controllers;

[ApiController]
[Route("api/[controller]/[action]")]
[RoleAuthorize(RoleEnum.Admin)]
public class UserController(UserService userService, JwtHelper jwtHelper): ControllerBase {
   private readonly UserService _userService = userService;
   private readonly JwtHelper _jwtHelper = jwtHelper;

   // public Task


   /// <summary>
   /// 创建新用户
   /// </summary>
   /// <param name="data">UserSignInDto</param>
   [HttpPost("create")]
   [AllowAnonymous]
   public Task Create([FromBody] UserCreateRequest data) {
      return _userService.Create(data);
   }
}
